<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>第三个角的度数</title>
</head>
<body>
<%
    String method = request.getMethod();
    if (method.equals("POST")) {
        int a1 = Integer.parseInt(request.getParameter("first"));
        int a2 = Integer.parseInt(request.getParameter("second"));
        if (a1 + a2 <= 0 || a1 + a2 >= 180) {
            response.sendRedirect("input.html");
        }
    } else {
        response.sendRedirect("input.html");
    }
%>
<%-- 指令元素jsp:useBean的scope属性（作用域）的默认值为page --%>
<jsp:useBean id="triangle" class="bean.Angle">
    <jsp:setProperty name="triangle" property="*" />
    <%-- 当property属性值为*时，必须保证请求的参数名与JavaBean类中去掉set前缀的setter方法名一一对应
    <jsp:setProperty name="triangle" property="first" param="first" />
    <jsp:setProperty name="triangle" property="second" param="second" />
    当property属性值不为*时，必须指定param或value其中之一 --%>
</jsp:useBean>
第三个角的度数为：<jsp:getProperty name="triangle" property="third" />
<%-- 等价于triangle.getThird()，property的值必须是bean中去掉get的相应get方法名 --%>
</body>
</html>
